package com.imodia.checkoo.bean;

public class BasePageBean {
	
	protected Integer id;
	protected Integer parentId;
	protected Integer isHtml;
	protected String hrefUrl;
	protected String dynamicUrl;
	protected String htmlUrl;
	
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public Integer getIsHtml() {
		return isHtml;
	}
	public void setIsHtml(Integer isHtml) {
		this.isHtml = isHtml;
	}
	public String getHrefUrl() {
		if(isHtml!=null && isHtml==1){
			this.hrefUrl = this.htmlUrl;
		}else{
			if(dynamicUrl.indexOf("?")>0){
				hrefUrl = dynamicUrl+"&";
			}else{
				hrefUrl = dynamicUrl+"?";
			}
			if(dynamicUrl.indexOf("pageId=")<0){
				hrefUrl += "pageId="+id;
			}
			if(dynamicUrl.indexOf("pagePId=")<0 && parentId>0){
				hrefUrl += "&pagePId="+parentId;
			}
		}
		return hrefUrl;
	}
	
	public String getDynamicUrl() {
		if(dynamicUrl==null || dynamicUrl.trim().length()<=0){
			dynamicUrl ="pageView.do";
		}
		return dynamicUrl;
	}
	public void setDynamicUrl(String dynamicUrl) {
		this.dynamicUrl = dynamicUrl;
	}
	public String getHtmlUrl() {
		return htmlUrl;
	}
	public void setHtmlUrl(String htmlUrl) {
		this.htmlUrl = htmlUrl;
	}
	public Integer getParentId() {
		return parentId;
	}
	public void setParentId(Integer parentId) {
		this.parentId = parentId;
	}
	
	
}
